<div id="killList">
  <div class="listOptions">
    <span>Search: 
      <input type="text" id="killFind" value="{$find}" /> 
      <button onclick="window.location='{$site_url}/?module=kills{if $corp}&corp=1{/if}&find='+document.getElementById('killFind').value">Go</button>
      (Pilots, corporations, alliances, ships and systems)
    </span>
  </div>

  {if $pageCount > 0}
  <div align="right">
    {if $prevPage < $pageNum}
      <button onclick="window.location='{$site_url}/?module=kills{if $corp}&corp=1{/if}&p={$prevPage}'" class="pageNav"> &lt;&lt; </button>
    {/if}
    &nbsp; pg {$pageNum+1} / {$pageCount} &nbsp;
    {if $nextPage < $pageCount}
      <button onclick="window.location='{$site_url}/?module=kills{if $corp}&corp=1{/if}&p={$nextPage}'" class="pageNav"> &gt;&gt; </button>
    {/if}
  </div>
  {/if}

  {if !$kills}
    <h3>{if $corp}Your corporation has{else}You have{/if} no kills!</h3>
  {/if}

  {foreach from=$kills item=kill}
  <div class="killHead shadeDark boderDark" onclick="toggleKill({$kill.killID})">
    <img src="http://image.eveonline.com/Character/{$kill.victim.characterID}_64.jpg" alt="{$kill.victim.characterName}" align="left" style="padding-right: 5px; margin-right: 0px;" />
    <img src="{$site_url}/eveimages/types/64/{$kill.victim.ship.typeid}.png" alt="{$kill.victim.ship.typename}" align="left" />
      <h3>{$kill.victim.characterName}, {$kill.victim.corporationName}</h3>
      <h4>{$kill.solarSystem.solarsystemname}, {$kill.solarSystem.region.regionname} ({$kill.solarSystem.security|eveNum:1})</h4>
      {$kill.date|date_format:"%d/%m/%Y %H:%M"}
  </div>
  <div class="killDetail" id="{$kill.killID}" style="display:none">

    <div class="killInvolvedParties">
      <div class="title shadeMid borderDark textLight">Involved Parties</div>
        <div class="subTitle shadeLight borderLight textLight">Victim</div>
        <div class="character">
          <table border="0" width="100%">
            <tr>
              <td width="10%">
                <img src="http://image.eveonline.com/Character/{$kill.victim.characterID}_32.jpg" alt="{$kill.victim.characterName}" align="left" />
                <a href="#" onclick="showInfo({$kill.victim.ship.typeid});return false;">
                  <img src="{$site_url}/eveimages/types/32/{$kill.victim.ship.typeid}.png" alt="{$kill.victim.ship.typename}" align="left" />
                </a>
              </td>
              <td width="45%">
                <b>Pilot:</b> {$kill.victim.characterName}<br />
                <b>Corp:</b> {$kill.victim.corporationName}<br />
                <b>Alliance:</b> {$kill.victim.allianceName}
              </td>
              <td width="45%">
                <b>Ship:</b> {$kill.victim.ship.typename}<br />
                <b>Damage Taken:</b> {$kill.victim.damageTaken|eveNumInt}<br />
              </td>
            </tr>
          </table>
        </div>
        <div class="subTitle shadeLight borderLight textLight">Attackers</div>
        {foreach from=$kill.attackers item=attacker}
          <div class="character {cycle values='row,rowAlt'}">
            <table border="0" width="100%">
              <tr>
                <td width="10%">
                  {if $attacker.characterID > 0}
                    <img src="http://image.eveonline.com/Character/{$attacker.characterID}_32.jpg" alt="{$attacker.characterName}" align="left" />
                  {/if}
                  {if $attacker.ship.typeGraphic}
                    <a href="#" onclick="showInfo({$attacker.ship.typeid});return false;">
                      <img src="{$site_url}/eveimages/types/32/{$attacker.ship.typeid}.png" alt="{$attacker.ship.typename}" align="left" />
                    </a>
                  {elseif $attacker.ship.icon}
                    <a href="#" onclick="showInfo({$attacker.ship.typeid});return false;">
                      <img src="{$site_url}/eveimages/icons/32/icon{$attacker.ship.icon}.png" alt="{$attacker.ship.typename}" align="left" />
                    </a>
                  {/if}
                </td>
                <td width="45%">
                  <b>Pilot:</b> {$attacker.characterName}<br />
                  <b>Corp:</b> {$attacker.corporationName}<br />
                  <b>Alliance:</b> {$attacker.allianceName}
                </td>
                <td width="45%">
                  <b>Ship:</b> {$attacker.ship.typename}<br />
                  <b>Damage Dealt:</b> {$attacker.damageDone|eveNumInt}<br />
                  <b>Weapon:</b> {$attacker.weapon.typename}
                </td>
              </tr>
            </table>
          </div>
        {/foreach}
    </div>

    <div class="killDroppedItems">
      <div class="title shadeMid borderDark textLight">Victim's Items</div>
      <div class="subTitle shadeLight borderLight textLight">Dropped Items</div>
      <div class="dropDropped">
        <table border="0" width="100%">
          <tr class="sub">
            <td width="70%">Item</td>
            <td width="10%">Qty</td>
            <td width="20%">Value</td>
          </tr>
          {foreach from=$kill.itemsDropped item=item}
          <tr class="{cycle values='row,rowAlt'}">
            <td>
              <a href="#" onclick="showInfo({$item.item.typeid});return false;">
                {if $item.item.typeGraphic}
                  <img src="{$site_url}/eveimages/types/32/{$item.item.typeid}.png" alt="{$item.item.typename}" align="absmiddle" />
                {else}
                  <img src="{$site_url}/eveimages/icons/32/icon{$item.item.icon}.png" alt="{$item.item.typename}" align="absmiddle" />
                {/if}
              </a>
              {$item.item.typename}
            </td>
            <td align="right">
              {$item.qtyDropped|eveNumInt}
            </td>
            <td align="right">
              {$item.item.pricing.avgSell*$item.qtyDropped|eveNum}
            </td>
          </tr>
          {/foreach}
        </table>
      </div>

      <div class="subTitle shadeLight borderLight textLight">Destroyed Items</div>
      <div class="dropDestroyed">
        <table border="0" width="100%">
          <tr class="sub">
            <td width="70%">Item</td>
            <td width="10%">Qty</td>
            <td width="20%">Value</td>
          </tr>
          {foreach from=$kill.itemsDestroyed item=item}
          <tr class="{cycle values='row,rowAlt'}">
            <td>
              <a href="#" onclick="showInfo({$item.item.typeid});return false;">
                {if $item.item.typeGraphic}
                  <img src="{$site_url}/eveimages/types/32/{$item.item.typeid}.png" alt="{$item.item.typename}" align="absmiddle" />
                {else}
                  <img src="{$site_url}/eveimages/icons/32/icon{$item.item.icon}.png" alt="{$item.item.typename}" align="absmiddle" />
                {/if}
              </a>
              {$item.item.typename}
            </td>
            <td align="right">
              {$item.qtyDestroyed|eveNumInt}
            </td>
            <td align="right">
              {$item.item.pricing.avgSell*$item.qtyDestroyed|eveNum}
            </td>
          </tr>
          {/foreach}
        </table>
      </div>

      <div class="subTitle shadeLight borderLight textLight">Total Financial Loss</div>
      <table border="0" width="100%">
        <tr class="sub">
          <td width="80%">Total</td>
          <td width="20%">Value</td>
        </tr>
        <tr class="row">
          <td>Ship Value</td>
          <td align="right">{$kill.shipValue|eveNum}</td>
        </tr>
        <tr class="rowAlt">
          <td>Dropped Items</td>
          <td align="right">{$kill.dropValue|eveNum}</td>
        </tr>
        <tr class="row">
          <td>Destroyed Items</td>
          <td align="right">{$kill.destroyValue|eveNum}</td>
        </tr>
        <tr class="rowAlt">
          <td><b>Total</b></td>
          <td align="right"><b>{$kill.shipValue+$kill.dropValue+$kill.destroyValue|eveNum}</b></td>
        </tr>
      </table>

    </div>

    <div style="clear: both;"></div>
  </div>
  {/foreach}
</div>

{literal}
<script>
  function toggleKill(id) {
    var kill = document.getElementById(id);
    if (kill.style.display == '')
      kill.style.display = 'none';
    else
      kill.style.display = '';
  }
</script>
{/literal}